Local variables are declared within a function, and can only be used within that function. This is usually no problem, since when another function is called, all required data is passed to it as arguments. Alternatively, a veriable can be declared so it is available to all functions. This is called a global variable. Modern programming practice recommends against the excessive use of global variables. They can lead to poor program structure, and tend to clog up the available name space for variables.
A global variable is declared as normal, but outside any of the program's functions. This is usually done at the beginning of the program file, but after preprocessor directives. The variable is not declared again in the body of the function which accesses it.